<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.hrms.pojo.Admin"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员修改密码</title>
<script type="text/javascript" src="<%=path%>/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
	function checkinput() {
		var oldPassword = $("#oldPassword").val();
		if ($.trim(oldPassword) == "") {
			alert("原密码不能为空");
			return false;
		}
		var password = $("#password").val();
		if ($.trim(password) == "") {
			alert("新密码不能为空");
			return false;
		}
		var secPassword = $("#secPassword").val();
		if (password != secPassword) {
			alert("两次输入的密码不一致");
			return false;
		}
		return true;
	}
</script>
</head>
<body background="<%=path%>/images/background.jpg">
	<center>
		<jsp:include page="../top.jsp" flush="true"></jsp:include>
		<table width="800" height="48" border="0" cellpadding="0"
			cellspacing="0" background="<%=path%>/images/center1.jpg">
			<tr>
				<td valign="top">
					<table width="494">
						<tr>
							<td width="45" height="25"></td>
							<td width="437" valign="bottom"><a
								href="<%=path%>/admin/function"><b>主页</b></a>&gt;<a
								href="<%=path%>/admin/admin_L1"><b>系统管理</b></a>&gt;<font
								color="#FF0000">修改密码</font></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<table width="800" height="340" border="0" align="center"
			cellpadding="0" cellspacing="0"
			background="<%=path%>/images/center2.jpg">
			<tr>
				<td>
					<%
						Object obj = session.getAttribute("admin");
						Admin admin = (Admin) obj;
					%>
					<form
						action="<%=path%>/admin/<%=admin.getAdminId()%>/alter_password"
						method="post" onsubmit="return checkinput()">
						<table width="800" height="340" border="0" align="center"
							cellpadding="0" cellspacing="0"
							background="<%=path%>/images/center2.jpg">
							<tr>
								<td class="style4" height="40"><div align="center">原密码:</div></td>
								<td><input height="40" width="600" type="password"
									name="oldPassword" id="oldPassword"></td>
							</tr>
							<tr>
								<td class="style4" height="40"><div align="center">新密码:</div></td>
								<td><input height="40" width="600" type="password"
									name="password" id="password"></td>
							</tr>
							<tr>
								<td class="style4" height="40"><div align="center">重复密码:</div></td>
								<td><input height="40" width="600" type="password"
									name="secPassword" id="secPassword"></td>
							</tr>
							<tr>
								<td class="style4" height="40"><div align="center">操作</div></td>
								<td><input type="submit" value="提交">&nbsp;<input
									type="reset" value="重置"></td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>
		<jsp:include page="../down.jsp" flush="true" />
	</center>
</body>
</html>